package phapp.service.system.impl;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import cn.org.rapid_framework.page.Page;
import cn.org.rapid_framework.page.PageRequest;
import javacommon.base.*;

import phapp.model.system.*;
import phapp.dao.system.*;
import phapp.service.system.impl.*;
import phapp.service.system.*;
/**
 * <p> 标题: 用户与角色对应, ts_user_role  业务处理层
 * <p>Description: spring事务实现层,调用Dao层取数据
 * <p>Copyright: Copyright (c) 2014-10
 * <p>Company: 
 * @see phapp.model.system.TsUserRole
 * @see phapp.service.system.TsUserRoleManager
 * @see phapp.dao.system.TsUserRoleDao
 * @author you name
 * @version 1.0
*/

@Component("tsUserRoleManager")
@Transactional
public class TsUserRoleManagerImpl extends BaseManager<TsUserRole,java.lang.Integer>
               implements TsUserRoleManager {

   /**定义Dao*/
   private TsUserRoleDao tsUserRoleDao;
   /**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性*/
   public void setTsUserRoleDao(TsUserRoleDao dao) {
      this.tsUserRoleDao = dao;
   }

   /**获取Dao*/
   public EntityDao getEntityDao() {
      return this.tsUserRoleDao;
   }

   /**
   * <p>分页查询TsUserRole<br>
   * @param PageRequest pr
   * @return Page 
   */
   @Transactional(readOnly=true)
   public Page findByPageRequest(PageRequest pr) {
      return tsUserRoleDao.findByPageRequest(pr);
   }

   /**
   * <p>批量删除 TsUserRole<br>
   * @param TsUserRole u
   * @return Boolean 
   */
   public Boolean  removeByIdArry(TsUserRole u) {
      Boolean result =false;
      int i =-1,size=u.getIdList().size();
      i =tsUserRoleDao.removeByIdArry(u);
      if(i==size){
         result =true;
      }else{
         throw new RuntimeException();
      }
      return result;
   }
   /**
   * <p> 标题:按Bean 删除<br> 
   * @param TsUserRole bean 
   */
   public int deleteByObj(Object bean){
	   return  tsUserRoleDao.deleteByObj(bean);
   }
	/**
	* <p>按Bean查询返回List<br> 
	* @param TsUserRole bean
	* @return List 
	*/
	public java.util.List  findListByBean(TsUserRole u) { 
		java.util.List<TsUserRole> list =  tsUserRoleDao.findListByBean(u); 
	      return list;
	}

}
